// JavaScript Document
function chest(){
	var csstext="#upgrade_an{height:80px;display:none;background:#353845}#upgrade_an.ie6{background:#353845 url(http://himg.china.cn/img/mainsite/ieup/ie6.jpg) no-repeat top center;}#upgrade_an.ie7{background:#353845 url(http://himg.china.cn/img/mainsite/ieup/ie7.jpg) no-repeat top center;}#upgrade_an.ie8{background:#353845 url(http://himg.china.cn/img/mainsite/ieup/ie8.jpg) no-repeat top center;}.ie{width:980px;margin:0 auto;height:80px;}.ie a{display:block;height:80px;}.ie a img{float:right;margin-top:20px}";
	 
	var style = document.createElement("style");
	style.type = "text/css";
	try{
	 style.appendChild(document.createTextNode(csstext));
	} catch (ex){
	 style.styleSheet.cssText =csstext;
	}
	var ohead = document.getElementsByTagName("head")[0];
	ohead.appendChild(style);
}

function myBrowser(){
	var userAgent = navigator.userAgent; //取得浏览器的 userAgent 字符串
	var isIE = userAgent.indexOf("compatible") > -1 &&
	userAgent.indexOf("MSIE") > -1; //判断是否 IE 浏览器
	if(isIE){
		var IE5 = IE6 = IE7 = IE8 = false;
		var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
		reIE.test(userAgent);
		var fIEVersion = parseFloat(RegExp["$1"]);
		IE6 = fIEVersion == 6.0 ;
		IE7 = fIEVersion == 7.0 ;
		IE8 = fIEVersion == 8.0 ;
		if(IE6){ return "IE6"; }
		if(IE7){ return "IE7"; }
		if(IE8){ return "IE8"; }
	}//isIE end
}
//myBrowser() end
//以下是调用上面的函数
/*if(myBrowser()=="IE6"){document.getElementById("boxie").style.display = "block";}
if(myBrowser()=="IE7"){document.getElementById("boxieqi").style.display = "block";}
if(myBrowser()=="IE8"){document.getElementById("boxieba").style.display = "block";}*/

if(myBrowser()=="IE6"){
	ie("ie6");
}else if(myBrowser()=="IE7"){
	ie("ie7");
}else if(myBrowser()=="IE8"){
	ie("ie8");
};
function ie(classc){
	chest();
	var div=$("<div>");
		div.attr({id:"upgrade_an"});
		$("body").prepend(div);
	$("#upgrade_an").html(" ").removeClass("class").addClass(classc).show();
	var div=$("<div>");
		div.addClass("ie");
		div.html("<a href='http://cn.china.cn/notice/ie-update.html' target='_blank' rel='nofollow'><img src='http://himg.china.cn/img/mainsite/ieup/ie6_btn.jpg' alt='立即升级' width='172' height='44' align='absmiddle'></a>");
		$("#upgrade_an").append(div);
}
